package io.lvdaxian.handwriting.clone;

/**
 * 自定义 用户对象
 *
 * @author lihh
 */
public class User implements Cloneable {
  private String name;
  public Person person;
  
  public User() {
  }
  
  public User(String name, Person person) {
    this.name = name;
    this.person = person;
  }
  
  @Override
  protected Object clone() throws CloneNotSupportedException {
    return super.clone();
  }
  
  public static void main(String[] args) throws CloneNotSupportedException {
    User u1 = new User("lihh", new Person());
    User u2 = (User) u1.clone();
    
    System.out.println(u1 == u2);
    System.out.println(u1.person == u2.person);
  }
}
